<h1>Import</h1>

<p>Import is used to import shapes and other objects from another Flash file. Since the identifier for an object is only unique within a given Flash file, imported objects are referenced by a name assigned when the object is exported.</p>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">type</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">10</td>
<td>Identifies the Export instruction when it is encoded. It is encoded 
with the length field as a 16-bit integer (Little-endian byte order).</td>
</tr>

<tr>
<td nowrap valign="top">length</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">6</td>
<td>The length in bytes of the body of the instruction when it is encoded. Encoded with the type 
field as a 16-bit integer. If the length is greater than 62 bytes then this field
is set to 0x3F and the next field, extendedLength contains the length of the
body of the encoded instruction.</td>
</tr>

<tr>
<td nowrap valign="top">extendedLength</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">32</td>
<td>Optional. Contains the length in bytes of the encoded instruction if it is
greater than 62 bytes. If the length is 62 bytes or less then this field is 
omitted.</td>
</tr>

<tr>
<td nowrap valign="top">url</td>
<td nowrap valign="top">String</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>The URL of the file containing the object to be imported. The URL must be in 
the same sub-domain and relative to the URL of the Flash file containing the 
file importing the object.</td>
</tr>

<tr>
<td nowrap valign="top">count</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td>The number of identifier-name pairs in the import instruction.</td>
</tr>

<tr>
<td nowrap valign="top">imports</td>
<td nowrap valign="top">identifier/String</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>An array identifier/string pairs where the identifier is the unsigned 16-bit
identifier assigned to the object being imported and the value is name assigned 
to the object when it was exported.</td>
</tr>

</table>

<p>To provide a degree of security the Flash Player will only import files that originate from the same domain as the file that it is currently playing. For example if the Flash file being shown was loaded from www.mydomain.com/flash.swf then the file contains the exported objects must reside somewhere at www.mydomain.com. This prevents a malicious Flash file from loading files from an unknown third party.</p>

<h2>History</h2>

<p>Import represents the ImportAssets data structure in the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 5.</p>
